當然也可以使用其他port
),但沒有指定該流量的路由這部分需要由virtualservice來倒流量至服務,對應virtualservice 中的spec.hosts & spec.gateways參數,設定來說通常會把gateway&virtualservice放在指定的k8s namespace底下,由下列YAML範例來說明:apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: my-gateway-name #指定gateway配置的代理,如具有標籤app: my-gateway-name的pod
spec:
selector:
istio: my-gateway #對應virtualservice spec.gateways
servers:
- port: #加密傳輸
number: 443
name: https
protocol: HTTPS
tls:
mode: SIMPLE
serverCertificate: /etc/istio/ingressgateway-certs/tls.crt #設定憑證路徑
privateKey: /etc/istio/ingressgateway-certs/tls.key #設定憑證路徑
hosts:
- "*" #該服務對應domain
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "*" #該服務對應domain